local year=year in 1

/* Labor-market status */

	if 1979<=`year' & `year'<=1988 {
		gen byte lfstat=1 if esr==1 | esr==2
		replace lfstat=2 if esr==3
		replace lfstat=3 if 4<=esr & esr<=7
	}
	if 1989<=`year' & `year'<=1993 {
		gen byte lfstat=1 if lfsr89==1 | lfsr89==2
		replace lfstat=2 if 3<=lfsr89 & lfsr89<=4
		replace lfstat=3 if 5<=lfsr89 & lfsr89<=7
	}
	if 1994<=`year' {
		gen byte lfstat=1 if lfsr94==1 | lfsr94==2
		replace lfstat=2 if 3<=lfsr94 & lfsr94<=4
		replace lfstat=3 if 5<=lfsr94 & lfsr94<=7
	}
	lab var lfstat "Labor-force status"
	#delimit ;
	lab def lfstat
		1 "Employed"
		2 "Unemployed"
		3 "NILF"
	;
	#delimit cr
	lab val lfstat lfstat
	notes lfstat: CPS: derived from a-lfsr, pemlr


	/* Employed */
	gen byte empl=0 if lfstat~=.
	replace empl=1 if lfstat==1
	lab var empl "Employed"
	notes empl: CPS: derived from a-lfsr, pemlr

	/* Unemployed */
	gen byte unem=0 if lfstat~=.
	replace unem=1 if lfstat==2
	lab var unem "Unemployed"
	notes unem: CPS: derived from a-lfsr, pemlr

	/* Not in labor force */
	gen byte nilf=0 if lfstat~=.
	replace nilf=1 if lfstat==3
	lab var nilf "Not in labor force"
	notes nilf: CPS: derived from a-lfsr, pemlr
